﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace APIExplorer
{
    public class MainViewModel: IMainViewModel
    {


        public event System.ComponentModel.PropertyChangedEventHandler PropertyChanged;


        public string CompanyAccountId
        {
            get;
            set;
        }

        public string ConsumerKey
        {
            get;
            set;
        }

        public string ConsumerSecret
        {
            get;
            set;
        }

        bool threeLegged;
        public bool ThreeLegged
        {
            get
            {
                return threeLegged;
            }
            set
            {
                threeLegged = value;
                TokenEnabled = threeLegged;
                TokenSecretEnabled = ThreeLegged;
            }
        }

        public string Token
        {
            get;
            set;
        }

        bool tokenEnabled; 
        public bool TokenEnabled
        {
            get
            {
                return tokenEnabled;
            }
            set
            {
                tokenEnabled = value;
                this.FireEvent(PropertyChanged, m => m.TokenEnabled);
            }
        }

        public string TokenSecret
        {
            get;
            set;
        }

        public bool TokenSecretEnabled
        {
            get;
            set;
        }

        public string Method
        {
            get;
            set;
        }

        public string[] Methods
        {
            get { return new string [] {"GET", "PUT", "POST", "DELETE", "HEAD"}; }
        }

        public string AcceptMimeType
        {
            get;
            set;
        }

        public string[] AcceptedMimeTypes
        {
            get { return new string[] { "application/json", "text/xml", "text/plain" }; }
        }

        public string RequestUrl
        {
            get;
            set;
        }

        public string ContentType
        {
            get;
            set;
        }

        
        public string Request
        {
            get;set;
        }

        string response;
        public string Response
        {
            get
            {
                return response;
            }
            set
            {
                response = value;
                this.FireEvent(PropertyChanged, m => m.Response);

            }
        }

        string debugLog;
        public string DebugLog
        {
            get
            {
                return debugLog;
            }
            set
            {
                debugLog = value;
                this.FireEvent(PropertyChanged, m => m.DebugLog);
            }
        }
    }
}
